home *** CD-ROM | disk | FTP | other *** search
/ PC World Interactive 7 / PC World Interactive 7.iso / program / cprog.EXE / COKVERI.C < prev    next >
C/C++ Source or Header  |  1996-07-05  |  2KB  |  39 lines

  1. main()
  2. {
  3.     int a;              /* basit tamsayi tipi              */
  4.     long int b;         /* uzun tamsayi tipi               */
  5.     short int c;        /* kisa tamsayi tipi               */
  6.     unsigned int d;     /* isaretsiz (+ - siz) tamsayi     */
  7.     char e;             /* karakter tipi                   */
  8.     float f;            /* kayar nokta tipi                */
  9.     double g;           /* cift hassasiyet kayar nokta     */
  10.  
  11.     a = 1023;
  12.     b = 2222;
  13.     c = 123;
  14.     d = 1234;
  15.     e = 'X';
  16.     f = 3.14159;
  17.     g = 3.1415926535898;
  18.  
  19.     printf("a = %d\n",a);      /* desimal               */
  20.     printf("a = %o\n",a);      /* oktal                 */
  21.     printf("a = %x\n",a);      /* heksadesimal          */
  22.     printf("b = %ld\n",b);     /* uzun desimal          */
  23.     printf("c = %d\n",c);      /* kisa desimal          */
  24.     printf("d = %u\n",d);      /* isaretsiz             */
  25.     printf("e = %c\n",e);      /* karakter              */
  26.     printf("f = %f\n",f);      /* kayar nokta           */
  27.     printf("g = %f\n",g);      /* cift hassasiyet k.n   */
  28.     printf("\n");
  29.     printf("a = %d\n",a);      /* basit 'int' cikti          */
  30.     printf("a = %7d\n",a);     /* 7 uzunlukta bir saha kullan*/
  31.     printf("a = %-7d\n",a);    /* sola dayali 7 lik saha     */
  32.     printf("\n");
  33.     printf("f = %f\n",f);      /* basit kayan nokta     */
  34.     printf("f = %12f\n",f);    /* 12 lik bir saha kullan*/
  35.     printf("f = %12.3f\n",f);  /* noktadan sonra 3 hane */
  36.     printf("f = %12.5f\n",f);  /* noktadan sonra 5 hane */
  37.     printf("f = %-12.5f\n",f); /* sola yapisik 12 hane  */
  38. }
  39.